home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 8 / HYPERLIB-1993-VOL8-CD1.ISO.7z / HYPERLIB-1993-VOL8-CD1.ISO / Wingz / Demo for 9inch Monitor / WZAP / MITSUM.WKZ (.txt) < prev    next >
Wingz Spreadsheet  |  1992-07-21  |  44KB  |  354 lines

  1. WNGZWZSS0120
  2. AUTOSAVE.WKZ
  3. System    @"
  4. ~"    @ 
  5. System    @
  6. Osaka    @ 
  7. System
  8. MITSUM.WKZ
  9. folder
  10. 89-10201
  11. [1800ZA
  12.  TYPE C
  13.  TYPE D
  14.  TYPE E
  15. AM/FM
  16. [1800ZA
  17. [2000GT
  18. [2000GT limited
  19. [2000GT TURBO
  20. [2000ZA
  21. [2500GT
  22. MITSUM.WKZ
  23. MITSUM.WKZ:do_it = 0
  24. 5MITSUM.WKZ:volume = ctvalue(3,0) MITSUM.WKZ:do_it = 1
  25. MITSUM.WKZ5
  26. MITSUM.WKZ:do_it = 0
  27. UMITSUM.WKZ:selection = ctvalue(3,0) call MITSUM.WKZ:store_data() MITSUM.WKZ:do_it = 1
  28. add list box items "
  29. ]MITSUM.WKZ:selection = ctvalue(3,0) call MITSUM.WKZ:get_data() call MITSUM.WKZ:set_controls()
  30. 7MITSUM.WKZ:do_it = 2 call MITSUM.WKZ:store_data() close
  31. >MITSUM.WKZ:do_it = 3 MITSUM.WKZ:selection = ctvalue(3,0) close
  32. [MITSUM.WKZ:do_it = 4 call MITSUM.WKZ:store_data() MITSUM.WKZ:selection = ctvalue(3,0) close
  33. MITSUM.WKZ
  34. folder
  35. offset_x
  36. offset_y
  37. folder
  38. do_it
  39. selection
  40. loop_flag
  41. serial
  42. product_name
  43. price
  44. pricedown_limit    
  45. volume
  46. offset_x
  47. offset_y
  48. do_volume]
  49. do_select
  50. create_dialog
  51. paste_data
  52. add_data
  53. delete_data|
  54. reprace_data
  55. get_dataA
  56. store_data
  57. enter_valueF
  58. set_controls
  59. search_name
  60.     MITSUM.WKZ
  61.     copyright (C) 1992 ASCII Corporation
  62.     Auther taku-k
  63. define folder, flag, do_it, selection, i, loop_flag
  64. define serial, product_name, price, pricedown_limit
  65. define volume
  66. define offset_x, offset_y
  67. on activate
  68.     if not flag
  69.         folder = left(name(), length(name()) - length("MITSUM.WKZ") )
  70.         offset_x = 1
  71.         offset_y = 100
  72.         flag = 1
  73.         zoom window
  74.         go to cell a19
  75.     end if
  76. repaint window
  77. end activate
  78. function do_volume(n)
  79.     volume = indirect(makecell(4,25+n))
  80.     new modal dialog box at(-1,-1)(2.6inch,1.1inch)
  81.         add push button  "
  82. g", "
  83. " at (1.3inch,0.1inch)+(0.9inch,1.0inch)
  84.             dialog cancel push button
  85.             script "MITSUM.WKZ:do_it = 0"
  86.             select control 1
  87.             dialog default push button
  88.             script "MITSUM.WKZ:volume = ctvalue(3,0) MITSUM.WKZ:do_it = 1"
  89.         add number wheel at (0.1inch,0.2inch)+(0.9inch,0.7inch)
  90.             number wheel range 1 to 100
  91.             number wheel step 1
  92.             number wheel precision 0
  93.             number wheel position volume
  94.             show control title "
  95.     use dialog box
  96.     if do_it
  97.         put volume into makecell(4,25+n)
  98.     end if
  99. end function
  100. function do_select(n)
  101.     product_name = indirect(makecell(3,25+n))
  102.     price = indirect(makecell(5,25+n))
  103.     pricedown_limit = indirect(makecell(6,25+n))
  104.     loop_flag = 1
  105.     while loop_flag
  106.         call create_dialog()
  107.         case do_it
  108.             when 1
  109.                 call paste_data(n)
  110.                 loop_flag = 0
  111.                 exit case
  112.             when 2
  113.                 call add_data()
  114.                 exit case
  115.             when 3
  116.                 call delete_data()
  117.                 exit case
  118.             when 4
  119.                 call reprace_data()
  120.                 exit case
  121.             otherwise        { cancel button }
  122.                 go to window MITSUM.WKZ:folder & "MITSUM.WKZ"
  123.                 loop_flag = 0
  124.         end case
  125.     end while
  126.     repaint window
  127. end function
  128. function paste_data(n)
  129.         if product_name = "0"
  130.             for i = 3  to 7
  131.                 put "" into makecell(i,25+n)
  132.             end for
  133.         else
  134.             put product_name into makecell(3,25+n)
  135.             put price into makecell(5,25+n)
  136.             put pricedown_limit into makecell(6,25+n)
  137.             put "=D" & 25+n & "*E" & 25+n  & "*F" & 25+n  into makecell(7,25+n)
  138.         end if
  139. end function
  140. function add_data()
  141.     repaint off
  142.     select range makerange(1, 100, 32768, 100)
  143.     insert
  144.     put product_name into makecell(offset_x+1, offset_y)
  145.     put price into makecell(offset_x+2, offset_y)
  146.     put pricedown_limit into makecell(offset_x+3, offset_y)
  147.     unselect
  148.     go to cell a19
  149.     repaint on
  150. end function
  151. X -> 
  152. function delete_data()
  153.     repaint off
  154.     select range makerange(1, offset_y+selection-1, 32768, offset_y+selection-1)
  155.     delete
  156.     unselect
  157.     go to cell a19
  158.     repaint on
  159. end function
  160. function reprace_data()
  161.     put product_name into makecell(2,offset_y+selection-1)
  162.     put price into makecell(3,offset_y+selection)
  163.     put pricedown_limit into makecell(4,offset_y+selection)
  164. end function
  165. function get_data()
  166.     product_name = indirect(makecell(2,offset_y+selection-1))
  167.     price = indirect(makecell(3,offset_y+selection-1))
  168.     pricedown_limit = indirect(makecell(4,offset_y+selection-1))
  169. end function
  170. function store_data()    
  171.     product_name = ctstring(4,0)
  172.     price = enter_value(ctstring(5,0))
  173.     pricedown_limit = ctvalue(6,0)/100
  174. end function
  175. function set_controls()
  176.     select control 4 
  177.         field text product_name
  178.     select control 5
  179.         field text nformat(price,512+32) {
  180.     select control 6
  181.         number wheel  position pricedown_limit*100
  182. end function
  183. function enter_value(st)
  184.     define i, temp
  185.     temp = ""
  186.     for i = 1 to length(st)
  187.         temp = temp & if(code(mid(st,i-1,1))>= code("0") and code(mid(st,i-1,1))<= code("9"),mid(st,i-1,1),"")
  188.     end for
  189.     return value(temp)
  190. end function
  191. function create_dialog()
  192.     new modal dialog box at(-1,-1)(5inch,4.1inch)
  193.         add push button  "
  194. g", "
  195. " at (3.9inch,2.9inch)+(1.0inch,1.2inch)
  196.             dialog cancel push button
  197.             script "MITSUM.WKZ:do_it = 0"
  198.             select control 1
  199.             dialog default push button
  200.             script "MITSUM.WKZ:selection = ctvalue(3,0) call MITSUM.WKZ:store_data() MITSUM.WKZ:do_it = 1"
  201.         {control 3}
  202.         add list box "" at (0.1inch, 0.1inch)+(4.8inch,2.3inch)
  203.         i = 0
  204.         while not isblank(range(makecell(offset_x+1, offset_y+i )))
  205.             run "add list box items """ &
  206.                 indirect(makecell(MITSUM.WKZ:offset_x+1, MITSUM.WKZ:offset_y+i))  & """"
  207.             i = i + 1
  208.         end while
  209.         add list box items "(
  210.         show scroll bar list box
  211.         if search_name()
  212.             current list box item  product_name
  213.         end if
  214.         script "MITSUM.WKZ:selection = ctvalue(3,0)" &
  215.             " call MITSUM.WKZ:get_data() call MITSUM.WKZ:set_controls()"
  216.         {control 4}
  217.         add field  at ( 0.1inch, 2.5inch)+(4.8inch, 0.3inch)
  218.         show control name "
  219.         {control 5}
  220.         add field  at ( 0.1inch, 3.0inch)+(2.3inch, 0.3inch)
  221.         show control name "
  222.         {control 6}
  223.         add number wheel at ( 0.1inch, 3.5inch)+(1.8inch, 0.4inch)
  224.         show control name "
  225.         number wheel range 0 to 100
  226.         number wheel precision 0
  227.         number wheel step 1
  228.         {control 7-9}
  229.         add push button "
  230. X" at (2.5inch,2.9inch)+(1.0inch,1.1inch)
  231.             select control 7
  232.             script "MITSUM.WKZ:do_it = 2 call MITSUM.WKZ:store_data() close"
  233.             select control 8
  234.             script "MITSUM.WKZ:do_it = 3 MITSUM.WKZ:selection = ctvalue(3,0) close"
  235.             select control 9
  236.             script "MITSUM.WKZ:do_it = 4 call MITSUM.WKZ:store_data() MITSUM.WKZ:selection = ctvalue(3,0) close"
  237.         call set_controls()
  238.     use dialog box
  239. end function
  240. function search_name()
  241.     define i
  242.     i = 0
  243.     while not isblank(range(makecell(offset_x+1, offset_y+i )))
  244.             if indirect(makecell(offset_x+1, offset_y+i)) = product_name
  245.                 return 1
  246.             end if
  247.             i = i + 1
  248.     end while
  249.     return 0
  250. end function
  251. Osaka
  252. vtton
  253. helpdialog
  254. on mouseup
  255.     call helpdialog()
  256. end mouseup
  257. function helpdialog()
  258. define  i
  259.     new modal dialog box at (-1, -1)(6inch, 4.1inch)
  260.     add push button  "
  261. " at (2.5inch, 3.7inch)+(1.0inch, 0.35inch)
  262.     dialog default push button
  263.     add field at (.1inch, .1inch) (5.9inch, 3.5inch)
  264.     show scroll bar field
  265.     field text "
  266.     replace field text "REP" with "
  267. REP" options "A"
  268.     replace field text "REP" with "
  269. REP" options "A"
  270.     replace field text "REP" with "
  271. REP" options "A"
  272.     replace field text "REP" with "
  273. BREP" options "A"
  274.     replace field text "REP" with "
  275. REP" options "A"
  276.     replace field text "REP" with "
  277. BREP" options "A"
  278. replace field text "REP" with "
  279. REP" options "A"
  280. replace field text "REP" with "
  281. REP" options "A"
  282. replace field text "REP" with "
  283. REP" options "A"
  284.     replace field text "REP" with "
  285. REP" options "A"
  286.     replace field text "REP" with "
  287. REP" options "A"
  288.     replace field text "REP" with "
  289. REP" options "A"
  290.     replace field text "REP" with "
  291. REP" options "A"
  292.     replace field text "REP" with "
  293. REP" options "A"
  294.     replace field text "REP" with "
  295. REP" options "A"
  296.     replace field text "REP" with "
  297. " options "A"
  298.     for i = 1 to 13
  299.         find field text "
  300. " options "A"
  301.         text style "B"
  302.     end for
  303.     find field text "
  304. g" options "A"
  305.     unselect
  306. {    lock field text}
  307. repaint selections off
  308. use dialog box
  309. repaint selections on
  310. end function
  311. Osaka
  312. Button
  313. hide controls
  314. print dialog
  315. show controls
  316. Osaka
  317. New Button
  318. New Button
  319. MITSUM.WKZ
  320. do_volumeon mouseup
  321.     call MITSUM.WKZ:do_volume(int( mousey() / controlheight() * 12))
  322. end mouseup
  323. Osaka
  324. System
  325. New Button
  326. New Button
  327. MITSUM.WKZ
  328. do_selecton mouseup
  329.     call MITSUM.WKZ:do_select(int( mousey() / controlheight() * 12))
  330. end mouseup
  331. Osaka
  332. System
  333. EXITButton
  334. exit_buttonrepaint object "EXIT"
  335. close now
  336. on repaint
  337.     call jtf:exit_button()
  338. end repaint
  339. Osaka
  340. System
  341. homeButton
  342. home_action
  343. home_buttoncall jtf:home_action()
  344. on repaint
  345.     call jtf:home_button()
  346. end repaint
  347. Osaka
  348. System
  349. Osaka
  350. Chicago
  351. Chicago
  352. Chicago
  353. Osaka
  354.